home *** CD-ROM | disk | FTP | other *** search
- /*****************************************************************************/
- /* (C) 1993,1994 R. NADE - M. GRANDCHAMP - All Rights Reserved */
- /*****************************************************************************/
- /* This source-code is NOT public domain nor Freeware, this is part of */
- /* 'The C Programming Package' which is Shareware. */
- /* If you use this code, please register and get a free Full-VGA version */
- /*****************************************************************************/
- /*---------------------*
- * CPPLTXT.C *
- * Integrator Program *
- * for managers and *
- * linked programs *
- *---------------------*/
-
- /* Included Files */
- # include <stdio.h>
- # include <io.h>
- # include <conio.h>
- # include <dir.h>
- # include <dos.h>
-
- /* Global Variables */
- /* Variables in relation with config & menus */
- int x1,y1,x1,x2,xms,xmsa,yms,ymsa,colour1,colour2,colour3,colour4,colour5;
- int cardtype,divx,divy,printer,pagemaxi,videocard,nbdisk,hexa;
- int menu0,menu1,menu2,menu3,menu4,menu5,menu6,menu7,menu8,menu9,menu10;
- int colourchoice,return0,return1,return2,return3,chx2,recording;
- unsigned int jouract,monthact,yearact,ref,nbref,nbrep;
- unsigned char path[65],record[65],work[65],filedir[65],saverep[65];
- struct ffblk ffblk;
- struct dfree dfree;
- struct directory{
- unsigned char name[9];
- unsigned char ext[4];
- unsigned char size[9];
- unsigned char attribut[2];
- unsigned char date[9];
- unsigned char time[6];
- } directory;
-
- /* Variables useable in all programs */
- int bm,choice,i,j,k,l,m,line,lline,linemax,modif,n,t,x,xm,y,y1,y2,ym,z;
- int returning,beginningfile,endfile;
- int button,soundvar,intro,music,number,mode,modif;
- int numact,chx,chif,background,colourprov;
- int pfdiv,pfserv,pfhelp,pfic;
- long dep,dephelp,depdiv,tbeginning,tend,tdiff,depbeginning,enddep,depfile;
- unsigned long nbbytes;
- unsigned char c0,c1,c2,nc1[11],nc2[11],letbis[2],screen2[640],divers[150];
- unsigned char trashcan[81],trashhelp[9],trashelhelp[41],trashret[81];
- unsigned char buff1[2],namefile[13],screen[4000],screenhelp[4000];
- char *beginning,*theend,*memory,*diversity;
- struct text_info ti;
- struct text_info thelp;
-
- /*-------------------------*
- * MESSAGE (error message) *
- * 5 lines of 20 chars *
- *-------------------------*/
- int message(lin1,lin2,lin3,lin4,lin5)
- unsigned char lin1[20],lin2[20],lin3[20],lin4[20],lin5[20];
- {
- /* Draw a window with the message sent */
- /* but first we save the screen ! */
- save_screen2(48,13);
- textattr(colour5); sound3();
- gotoxy(48,13); cputs(" ");
- gotoxy(48,14); cputs(" ╔════════════════════╗ ");
- gotoxy(48,15); cputs(" ║ M E S S A G E ║ ");
- gotoxy(48,16); cputs(" ╟────────────────────╢ ");
- gotoxy(48,17); cputs(" ║ ║ ");
- gotoxy(48,18); cputs(" ║ ║ ");
- gotoxy(48,19); cputs(" ║ ║ ");
- gotoxy(48,20); cputs(" ║ ║ ");
- gotoxy(48,21); cputs(" ║ ║ ");
- gotoxy(48,22); cputs(" ╚════════════════════╝ ");
- gotoxy(48,23); cputs(" ");
- gotoxy(51,17); cputs(lin1);
- gotoxy(51,18); cputs(lin2);
- gotoxy(51,19); cputs(lin3);
- gotoxy(51,20); cputs(lin4);
- gotoxy(51,21); cputs(lin5);
- k=wait_for_a_key(); restore_screen2(48,13);
- return(k);
- }
- /*-------------------------*
- * WARNING (error message) *
- * 5 lines of 20 chars *
- *-------------------------*/
- void warning(lin1,lin2,lin3,lin4,lin5)
- unsigned char lin1[20],lin2[20],lin3[20],lin4[20],lin5[20];
- {
- /* Draw a window with the message sent */
- /* but first we save the screen ! */
- save_screen2(8,9);
- textattr(colour5); sound3();
- gotoxy(8,9); cputs(" ");
- gotoxy(8,10); cputs(" ╔════════════════════╗ ");
- gotoxy(8,11); cputs(" ║ ATTENTION ERROR ║ ");
- gotoxy(8,12); cputs(" ╟────────────────────╢ ");
- gotoxy(8,13); cputs(" ║ ║ ");
- gotoxy(8,14); cputs(" ║ ║ ");
- gotoxy(8,15); cputs(" ║ ║ ");
- gotoxy(8,16); cputs(" ║ ║ ");
- gotoxy(8,17); cputs(" ║ ║ ");
- gotoxy(8,18); cputs(" ╚════════════════════╝ ");
- gotoxy(8,19); cputs(" ");
- gotoxy(12,13); cputs(lin1);
- gotoxy(12,14); cputs(lin2);
- gotoxy(12,15); cputs(lin3);
- gotoxy(12,16); cputs(lin4);
- gotoxy(12,17); cputs(lin5);
- wait_for_a_key(); restore_screen2(8,9);
- }
- /*--------------------------------------------------------------------------*
- * MAIN LOOP *
- *-----------*/
- void main(argc,argv)
- int argc;
- char *argv[];
- {
- intro=1; music=1;
- /* Did we give an argument ? */
- if(argc>1){
- strcpy(buff1,argv[1]);
- /* If the argument was M or m we display only */
- /* the introduction without playing music */
- if((buff1[0]==77)||(buff1[0]==109)) music=0;
- /* If the argument was I or i we do not display the introduction */
- /* and we do not play the music, not tested after */
- if((buff1[0]==73)||(buff1[0]==105)) intro=0;
- }
- i=program_init();
- if(i==0){
- system("mode 80"); return;
- }
- games_with_the_mouse();
- /* Play the introduction and check the date to ensure */
- /* that the program is not too old */
- t=check_the_validity();
- if(t<1){
- /* The using date of this demo is over */
- warning(" The using date"," of this demo"," is over. Please"," ask for an update"," Press a key or click");
- system("mode 80"); return;
- }
- intro=0;
- if(intro==1){
- display_opening_screen();
- if(music==1) vivaldi_s_spring();
- else c1=getch();
- }
- /* Hide the cursor, do not show the blinking cursor during pause */
- _setcursortype(_NOCURSOR);
- /* display_init_screen(); */
- main_menu_manager();
- /* show the cursor before going to DOS */
- _setcursortype(_NORMALCURSOR);
- /* If required, we go back to the good drive */
- nc1[0]=path[0]; nc1[1]=path[1];
- nc1[2]=0x00; system(nc1);
- chdir(path);
- /* Back to the standard screen mode */
- system("mode 80"); return;
- }
- /* End of main program */
-